import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../views/Home.vue';


// 1.安装路由
Vue.use(VueRouter);
// 2.配置路由
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue'),
  },
  {
    path:'/about',
    name:'About',
    component: () => import('../views/About.vue'),
  },
  {
    path:'/register',
    name:'Register',
    component:require('@/views/Register').default
  }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
});

// 3.暴露出去
export default router;
